<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="google-site-verification" content="yaeorbXgKPwp5BDegBtAJEHYWFEFE-BViWTj74gJPrw" />
<!--  -->
<link href="/css/default.css" type="text/css" rel="stylesheet" />
<!--  -->
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/lang/cn.js"></script>
<script type="text/javascript" src="/js/mac/core.min.js"></script>
<title>JQuery MagicGrid 可展开式表格示例</title>
<meta name="description" content="JQuery MagicGrid 可展开式表格示例" />
<meta name="keywords" content="JQuery Grid Plugin" />
<script type="text/javascript" src="/js/mac/webapp.min.js"></script>
<script type="text/javascript" src="/js/jquery/mousewheel.js"></script>
<script type="text/javascript" src="/js/mac/pager.min.js"></script>
<link type="text/css" rel="stylesheet" href="/css/default/mac/grid/grid.min.css" />
<script type="text/javascript" src="/js/mac/grid.min.js"></script>
<style type="text/css">
.money { text-align: right; }
.demoPanel .viewPort { height: 420px; width: 480px; }
</style>
<script type="text/javascript">
$(function(){
	$('#nav_jump').change(function(){
		location = './' + this.value + '.html';
	}).val('exp');
	$('.demoSource').val($('#demo').html());
});
</script>
</head>
<body>
<div id="head">
	<a href="/"><img src="/css/images/logo_s.png" alt="logo" /></a>
	<div class="title">BOARSOFT.COM</div>
	<div class="right">
		<div>
			<a href="/public/lang.php?l=en">English</a>
			|
			<a href="/public/lang.php?l=cn">简体中文</a>
			|
			<a href="http://activemq.apache.org/" target="_blank">ActiveMQ</a>
			|
			<a href="https://redis.io/" target="_blank">Redis</a>
			|
			<a href="http://www.jquery.com/" target="_blank">JQuery</a>
		</div>
	</div>
</div><div id="nav">
	<div id="nav_path">
		&nbsp;&nbsp;
		<a href="/">Home</a>
		&gt;
		<a href="/mac/js/grid">JQuery MagicGrid</a>
		&gt;
		JQuery MagicGrid 可展开式表格示例	</div>
	<div id="nav_back">
		<a href="/mac/js/grid/doc" target="_blank">文档</a>
		|
		<a href="javascript:history.back()">后退</a>
		|
		<a href="/mac/js/grid/dl/exp.html">下载</a>
		|
		<select id="nav_jump">
			<option value="basic">JQuery MagicGrid 基本功能示例</option>
			<option value="exp">JQuery MagicGrid 可展开式表格示例</option>
			<option value="multiHeaders">JQuery MagicGrid 多行表头示例</option>
			<option value="fixCol">JQuery MagicGrid 固定列的表格示例</option>
			<option value="voucher">JQuery MagicGrid 凭证类型表格示例</option>
			<option value="edit">JQuery MagicGrid Inline 编辑示例</option>
			<option value="keyEvt">JQuery MagicGrid 按键事件插件示例</option>
		</select>
		&nbsp;&nbsp;
	</div>
	<div class="clear"></div>
</div>
<div class="demoInfo">
	<h2 class="demoTitle">JQuery MagicGrid 可展开式表格示例</h2>
</div>
<div id="demo" class="demoPanel"><style type="text/css">
.expGrid .icon { float: left; margin-top: 2px; }
</style>
<script type="text/javascript">
$(function(){
	var pg = $('body');
	var vw = pg.find('.view');
	vw.mac('grid', {
		cols : [{
			name: 'no', title : '&nbsp;', width: 18,
			render: function(r, tr){
				var a = $('<span class="icon icon-plus"></span>');
				a.click(function(){
					var yy = vw.find('.ybar>div');
					var pl = tr.exPanel;
					if(a.hasClass('icon-plus')){
						if(pl){
							pl.show();
						}else{
							pl = $('<ul style="background-color: #FFF; margin: 0px;"></div>');
							//you can load remote content here
							pl.append('<li>' + r.subject + '</li><li>'
								+ r.summary + '</li><li>Debit = '
								+ r.debit + '</li><li>Credit = ' + r.credit + '</li>'
							);
							tr.exPanel = pl.insertAfter(tr);
							$('<div class="clear"></div>').insertBefore(pl);
						}
						yy.height(yy.height() + pl.height());
						a.removeClass('icon-plus').addClass('icon-minus');
					}else{
						pl.hide();
						yy.height(yy.height() - pl.height());
						a.removeClass('icon-minus').addClass('icon-plus');
					}
				});
				return a;
			}
		},{
			field: 'summary', title : 'Summary', width: 140
		},{
			field: 'subject', title : 'Subject', width: 140
		},{
			field: 'debit', title : 'Debit', width: 76
		},{
			field: 'credit', title : 'Credit', width: 76
		}],
		loader: {
			url: '/mac/js/grid/data.php',
			params: { pageNo: 1, pageSize: 50 },
			autoLoad: true
		},
		pagerLength: 10
	});
});
</script>
<div class="viewPort demoPanel">
<div class="view grid expGrid"></div>
</div>
</div>
<textarea class="demoSource" wrap="off"></textarea>
<iframe src="/mac/js/related.php" class="related"></iframe>
<div id="foot">
Copyright © 2011. All rights reserved&nbsp;&nbsp;蜀ICP备11014774号-1&nbsp;&nbsp;
QQ: 7213571&nbsp;&nbsp;E-mail: pyh_jerry@163.com&nbsp;&nbsp;
<!-- 
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Ffc0b0282216be3d16055855d8c0e72d9' type='text/javascript'%3E%3C/script%3E"));
</script>
&nbsp;&nbsp;
 -->
</div></body>
</html>
